package com.kuangstudy.controller;

import com.kuangstudy.entity.User;
import com.kuangstudy.service.login.LoginService;
import com.kuangstudy.utils.result.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Description:
 * Author: ryt
 * Version: 1.0
 * Create Date Time: 2021/12/22 9:45.
 */
@RestController
public class LoginController {

    @Autowired
    private LoginService loginService;

    @PostMapping("/login/user")
    public ResponseResult login(@RequestBody User user) {
        // 登录
        return loginService.login(user);
    }


    @GetMapping("/logout/user")
    public ResponseResult logout() {
        // 退出登录
        return loginService.logout();
    }

}
